<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>04.模板字符串.html</title>
</head>

<body>
    <script>
        /**
         * 定义字符串的两种方式
         */
        let str01 = "abc";
        let str02 = 'abc'
        // 模板字符串中可以解析js中的数值  即为 模板字符串中可以写js代码
        // ${}

        const bj = "北京市"
        const arr = ["三国演义","红楼梦"]
        const stu = {
            name:"夏明",age:18
        }

        const city = `
        <ul>
            <li>${bj}</li>
            <li>${arr[0]}</li>
            <li>${arr.join("-")}</li>
            <li>${stu.name}-${stu.age}</li>
            <li>1+1=${1+1}</li>
        </ul>
        `
        console.log(city, typeof city);
    </script>



</body>

</html>